<?php if(!defined('CALL')) exit('No direct script access allowed');

include_once('lib/xtemplate.class.php');
include_once('ctrl/page.class.php');
include_once('view/v_usercard.class.php');
include_once('view/v_menus.class.php');
include_once('view/v_users.class.php');
include_once('models/m_user.class.php');

class PageProfile extends Page
{
	public function __construct($actor, $user)
	{
		parent::__construct($actor, $user);
		$this->page_name = "profile";
	}
	
	protected function gen_main()
	{
		$xtpl = new XTemplate("xtpl/main-profile.xtpl");
		$xtpl->assign('root', ROOT_URL);
		$xtpl->assign('actor_id', $this->actor->id);
		$xtpl->assign('username', $this->actor->props['username']);
		$xtpl->assign('email', $this->actor->props['mail']);
		$xtpl->assign('born', $this->actor->props['born']);
		$xtpl->assign('male', $this->actor->props['male']);
		$xtpl->assign('face', $this->actor->props['face']);
		$xtpl->assign('city_id', $this->actor->props['city_id']);
		$xtpl->assign('city', $this->actor->props['city']);
		$xtpl->assign('note', $this->actor->props['note']);
		$xtpl->parse('root');
		return $xtpl->text('root');
	}

	protected function gen_side()
	{
		$html = '';
		
		$menus = new vMenus();
		$html .= $menus->gen_search_form();
		
		$card = new vUsercard();
		$html .= $card->generate($this->actor, $this->actor, FALSE);
		return $html;
	}

	protected function add_css()
	{
		return "";
	}

	protected function add_css_files()
	{
		return "";
	}

	protected function add_js()
	{
		return "";
	}

	protected function add_js_files()
	{
		return "";
	}
}
